(in-package #:com.diffblue.deeptestutils)

(defclass Reflector ()
  ())

;; 32
(defmethod setField ((clz Reflector) obj fieldName newVal)
  (setFieldForClz clz (class-of obj) obj fieldName newVal))


;; 36
;; overwrite
(defmethod setFieldForClz ((clz Reflector) c o fieldName newVal)
  (let ((slot (find fieldName (c2mop:class-slots c) :test (lambda(a b) (string-equal a (symbol-name (c2mop:slot-definition-name b))))))
	 )
    (if (not (null slot))
	(setf (slot-value o (c2mop:slot-definition-name slot)) newval))))



;; 192
;; @Static
(defmethod forName ((reflector Reflector) className)
  (find-class className))

;; 391
(defmethod getInstance ((reflector Reflector) className)
  (make-instance className))



